﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ConsumptionTrendItemWise.aspx.cs"
    Inherits="Main_Reports_Inventory_ConsumptionTrendItemWise" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <script src="../../../JavaScript/Commons.js" type="text/javascript"></script>
    <style type="text/css">
        #overlay
        {
            position: fixed;
            z-index: 99;
            top: 0px;
            left: 0px;
            background-color: #f8f8f8;
            width: 100%;
            height: 100%;
            filter: Alpha(Opacity=90);
            opacity: 0.9;
            -moz-opacity: 0.9;
        }
        #theprogress
        {
            background-color: #fff;
            border: 1px solid #ccc;
            padding: 10px;
            width: 300px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            filter: Alpha(Opacity=100);
            opacity: 1;
            -moz-opacity: 1;
        }
        #modalprogress
        {
            position: absolute;
            top: 40%;
            left: 50%;
            margin: -11px 0 0 -150px;
            color: #990000;
            font-weight: bold;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="4000"
            EnablePageMethods="true" EnablePartialRendering="true">
        </asp:ScriptManager>
        <acc:heading ID="pagehead" runat="server" HeadingText="Consumption Trend ItemWise" />
        <asp:UpdateProgress ID="prgLoadingStatus" AssociatedUpdatePanelID="UPbtngetreport"
            runat="server" DynamicLayout="true">
            <ProgressTemplate>
                <div id="overlay">
                    <div id="modalprogress">
                        <div id="theprogress">
                            <asp:Image ID="imgWaitIcon" runat="server" ImageAlign="AbsMiddle" ImageUrl="~/Images/pleasewait.gif" /><br />
                            Please wait...
                        </div>
                    </div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <div>
       
            <table style="background-color: #EEEEEE; width: 100%; height: 30px;">
                <tr>
                    <td style="width: 10%;">
                        <asp:Label ID="lblRecordNo" runat="server"></asp:Label>
                    </td>
                    <td style="width: 12%;">
                        <asp:Label ID="lblperiod" runat="server"></asp:Label>
                    </td>
                    <td style="width: 10%;" align="right">
                        <span>Select Year</span>
                    </td>
                    <td style="width: 10%;">
                        <asp:DropDownList ID="ddlYear" runat="server" CssClass="dropdown">
                            <asp:ListItem Text="--Select Year--" Value="0"></asp:ListItem>
                            <asp:ListItem Text="2014" Value="2014"></asp:ListItem>
                            <asp:ListItem Text="2015" Value="2015"></asp:ListItem>
                            <asp:ListItem Text="2016" Value="2016"></asp:ListItem>
                            <asp:ListItem Text="2017" Value="2017"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="width: 5%;">
                        <asp:UpdatePanel ID="UPbtngetreport" runat="server">
                            <ContentTemplate>
                                <asp:Button ID="btngetreport" OnClientClick="return CheckDropdown();" runat="server"
                                    Text="Report" CssClass="button1" OnClick="btngetreport_Click" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <script type="text/javascript">
                            function CheckDropdown() {
                                if (document.getElementById("ddlYear").selectedIndex == "0") {
                                    alert("Please Select the Year.");
                                    return false;
                                }
                            }
                        </script>
                    </td>
                    <td align="right" style="width: 10%;">
                        <asp:Label ID="lblcolumnName" runat="server" Text="Column Name"></asp:Label>
                    </td>
                    <td style="width: 10%;">
                        <asp:DropDownList ID="ddlColumnname" runat="server" onchange="return ToHide_Show();"
                            CssClass="dropdown">
                            <asp:ListItem Value="0"> - Select Column(s) - </asp:ListItem>
                            <asp:ListItem Value="1">Item Code</asp:ListItem>
                            <asp:ListItem Value="2">Item Name</asp:ListItem>
                            <asp:ListItem Value="3">AltItem Code</asp:ListItem>
                            <asp:ListItem Value="4">BinRef</asp:ListItem>
                            <asp:ListItem Value="5">MPN</asp:ListItem>
                            <asp:ListItem Value="6">Project</asp:ListItem>
                            <asp:ListItem Value="7">Customer</asp:ListItem>
                            <asp:ListItem Value="8">Re-Order Qty</asp:ListItem>
                        </asp:DropDownList>
                        <script type="text/javascript">
                            function ToHide_Show() {
                                if (document.getElementById("ddlColumnname").value != "0") {
                                    //document.getElementById("txtValue").style["display"] = "block";
                                    //document.getElementById("lblvalue").style["display"] = "block";
                                    //document.getElementById("btnReport").style["display"] = "block";                                                    
                                }
                                else {
                                    //document.getElementById("txtValue").style["display"] = "none";
                                    //document.getElementById("lblvalue").style["display"] = "none";
                                    //document.getElementById("btnReport").style["display"] = "none";
                                }
                                document.getElementById("txtValue").value = '';
                            }
                        </script>
                    </td>
                    <td align="right" style="width: 2%;">
                        <asp:Label ID="lblvalue" runat="server" Text="Value"></asp:Label>
                    </td>
                    <td style="width: 5%;">
                        <asp:TextBox ID="txtValue" CssClass="input" Width="80px" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 3%;">
                        <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="button1"
                            OnClick="btnSearch_Click" />
                    </td>
                    <td style="width: 3%;" align="center">
                        <asp:ImageButton ID="imgbtnPrint" ToolTip="Print" runat="server"
                            Width="20px" OnClientClick="printpanel();" ImageUrl="../../../Images/print.png" />
                        <script type="text/javascript">
                            function printpanel() {
                                var printcontent = document.getElementById('grdViewPoStatus');
                                window.print(printcontent.innerHTML);
                            }
                        </script>
                    </td>
                    <td style="width: 3%; vertical-align: middle;" align="center">
                        <asp:ImageButton ID="ImgBtnExcel" ToolTip="Export to Excel" runat="server" Width="20px" ImageUrl="~/Images/Excel.png" OnClick="ImgBtnExcel_Click" />
                    </td>
                </tr>
            </table>
             <asp:UpdatePanel ID="upctiw" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="grdCTIW" Width="150%" runat="server" AutoGenerateColumns="false"
                        CssClass="gridview">
                        <Columns>
                            <asp:TemplateField HeaderText="S No.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Item Code" DataField="ITMCODE" />
                            <asp:BoundField HeaderText="Item Name" DataField="ITMDESC" />
                            <asp:BoundField HeaderText="AltItem Code" DataField="ITMALTDESC" />
                            <asp:BoundField HeaderText="Bin Ref" DataField="BINREF" />
                            <asp:BoundField HeaderText="MPN" DataField="MPNNO" ItemStyle-Wrap="true" FooterText="Total"
                                FooterStyle-Font-Bold="true" />
                            <asp:BoundField HeaderText="Total Lead Time [Days]" DataField="Totaltransittime"
                                ItemStyle-HorizontalAlign="Right" />
                            <asp:BoundField HeaderText="Location ID" DataField="locationId" />
                            <asp:BoundField HeaderText="ROL" DataField="REORDERQTY" DataFormatString="{0:0}"
                                ItemStyle-HorizontalAlign="Right" />
                            <asp:BoundField HeaderText="Project" DataField="projectname" />
                            <asp:BoundField HeaderText="Customer" DataField="Customer" />
                            <asp:BoundField DataField="jan" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="feb" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="mar" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="apr" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="may" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="jun" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="jul" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="aug" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="sep" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="oct" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="nov" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField DataField="dec" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                            <asp:BoundField HeaderText="Total Consumption" DataField="TotalConsumption" NullDisplayText="-"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0}" />
                        </Columns>
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    </form>
</body>
</html>
